/** 
 * @Title: Duty.java 
 * @Package com.prs.um.dutymanager.dto 
 * @Description: 职务的实体类
 * @author flybonew@163.com 
 * @date 2013-1-7 下午4:50:38 
 * @version V1.0 
 */  
package com.prs.um.dutymanager.dto;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.prs.um.usermanager.dto.User;

/** 
 * @ClassName: Duty 
 * @Description: 职务的实体类
 * @author flybonew@163.com
 * @date 2013-1-7 下午4:50:38 
 * 
 */
@Table(name="SYSTEM_DUTY")
@Entity
public class Duty implements Serializable{

	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name = "ID_",length=36)
	@GenericGenerator(name="uuid",strategy="uuid")
	@GeneratedValue(generator="uuid")
	private String id;
	
	@Column(name="USER_NAME_",length=50)
	private String name;
	
	@Column(name="INDEX_")
	private Integer index;
	
	@Column(name="DESCRIPTION_",length=1000)
	private String description;
	
	@ManyToMany(cascade= CascadeType.ALL,fetch=FetchType.EAGER)
	@JoinTable(name="T_DUTY_USER",joinColumns=@JoinColumn(name="DUTY_ID_"),
	inverseJoinColumns=@JoinColumn(name="USER_ID_"))
	private Set<User> userList;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getIndex() {
		return index;
	}

	public void setIndex(Integer index) {
		this.index = index;
	}

	public String getDescription() {
		return description;
	}


	public void setDescription(String description) {
		this.description = description;
	}


	public Set<User> getUserList() {
		return userList;
	}

	public void setUserList(Set<User> userList) {
		this.userList = userList;
	}
}
